Fix the IP and port verification logic during service registration#846
Open
lengyue1084 wants to merge 5 commits intonacos-group:masterfrom
Open
Fix the IP and port verification logic during service registration#846lengyue1084 wants to merge 5 commits intonacos-group:masterfrom
lengyue1084 wants to merge 5 commits intonacos-group:masterfrom
Conversation
-Added ValidIPAddress function to validate the validity of IPv4 and IPv6 addresses -The function returns nil to indicate validity, otherwise it returns an error message - introducing strings package to support string processing
-Implemented the VerifiDomain function to validate domain name format - check domain name length, label length, character composition, etc -Added the isAllDigits auxiliary function to check if the string contains all digits
…vice registration -Added legitimacy verification for IP addresses and domain names -Added validity check for port numbers to ensure they are within the valid range
修复服务注册时的IP和端口验证逻辑变更概述
变更文件
💡 小贴士与 lingma-agents 交流的方式📜 直接回复评论
📜 在代码行处标记
📜 在讨论中提问
|
…URLs -Modify the ValidDomain function to support processing full URLs (with http://or https://prefix) -Remove paths, query parameters, and fragments from the domain name -Remove ports from the domain name -Update the IP and domain name verification logic in the named client
Member
|
The IP field allows users to enter a domain name. Is it appropriate to perform format validation here? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
-Added legitimacy verification for IP addresses and domain names
-Added validity check for port numbers to ensure they are within the valid range